<template>
  <view class="question-detail-layout">
		<my-header title="问题详情"></my-header>
    <my-content class="content">
      <view style="visibility: hidden">1</view>
      <view class="cate">
        <view class="cate_header">{{ questionDetail.title }}</view>
        <view class="cate_box" v-html="questionDetail.content"></view>
      </view>
    </my-content>
  </view>
</template>

<script>
import api from '../../api'
export default {
  data() {
    return {
      questionDetail: {
        id: '',
      },
    }
  },
  onLoad(option) {
    this.questionDetail.id = option.id
    this.getData()
  },
  onShow() {},
  methods: {
    getData() {
      uni.showLoading({
        title: '数据加载中',
      })
      api.questions
        .show(this.questionDetail.id)
        .then((res) => {
          if (res.code === 200) {
            uni.hideLoading()
            this.questionDetail = res.data
          }
        })
        .catch((error) => {
          console.log(error)
        })
    },
  },
}
</script>

<style lang="scss" scoped>
.question-detail-layout {
  background: #141414;
  height: 100vh;
}
.content {
  background: #141414;
  height: 100vh;
  font-size: 28rpx;
  .cate {
    display: flex;
    flex-direction: column;
    .cate_header {
      height: 80rpx;
      font-size: 32rpx;
      font-weight: bold;
      line-height: 80rpx;
      margin-left: 40rpx;
			margin-right: 40rpx;
      margin-bottom: 20rpx;
			color: #DEDEDE;
    }
    .cate_box {
			font-size: 28rpx;
			color: #DEDEDE;
      margin-left: 40rpx;
			margin-right: 40rpx;

    }
  }
}
</style>
